precision mediump float;

uniform sampler2D u_samplerColor;
uniform float u_limit;

varying mediump vec2 v_uv;

void main()
{
	vec3 tex = texture2D(u_samplerColor, v_uv).rgb;
	float brightness = 0.3 * tex.r + 0.59 * tex.g + 0.11 * tex.b;
	float val = step(u_limit, brightness);

	gl_FragColor = vec4(tex * val, 1.0);
}
